package com.test.io.propertiesDemo;

import org.junit.Test;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * @version 1.0
 * @Author: 许啸林
 * @Date: 2021/6/4 16:31
 */
public class ProertiesReadDemo {
    @Test
    public void read() {
        Properties properties = new Properties();
        try {
            properties.load(new FileReader("src//my.properties"));
            // 把properties 配置信息显示到 系统输出流 PrintStream
            properties.list(System.out);
            System.out.println("============");
            System.out.println(properties.get("user"));
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }
    }
}
